{smcl}
{com}{sf}{ul off}{txt}{.-}
      name:  {res}<unnamed>
       {txt}log:  {res}/Users/karenferree/Documents/BOOK/Choice and Choice Set/JOP_note/January 2021/Revised version/Log file of replication.smcl
  {txt}log type:  {res}smcl
 {txt}opened on:  {res}16 Jul 2021, 15:51:11

{com}. do "/var/folders/9p/h57867vx21b19_t61z8yq3f40000gn/T//SD64085.000000"
{txt}
{com}. /******************************************************************************/
. /*                                                                      INFO                                                                      */
. /******************************************************************************/
. /*
> 
> PROJECT
>         Article: "Choice and Choice Set in African Elections"
>         Author: Karen Ferree
> 
> DO FILE
>         Purpose: replication files for JOP paper
>         Created: By Karen Ferree, July 2021
>         This file creates Tables 1 and 2, Figure 1, and Appendix Tables.
>         It first generates descriptive statistics for Ghana, then for Kenya, then for Uganda
>         Tables created manually by compiling descriptive statistics across cases
> */
. 
. 
. /******************************************************************************/
. /*                                                      GHANA                                                             */
. /******************************************************************************/
. 
. /* Load Ghana data */
. clear
{txt}
{com}. use "/Users/karenferree/Documents/BOOK/stata work/JOP_replication/Kef_jop_ghana.dta", clear
{txt}
{com}. 
. 
. /* Creating choice set variable legislative level GHANA */
. /* create mixed choice set variable (Ashanti level) */
. 
. gen co_eth_choice_parl_2008 = 1 if all_co_eth_parl_2008 == 0 & co_eth_parl_2008 == 1
{txt}(2,928 missing values generated)

{com}. replace co_eth_choice_parl_2008 = 0 if all_co_eth_parl_2008 == 1 | co_eth_parl_2008 == 0
{txt}(2,928 real changes made)

{com}. lab var co_eth_choice_parl_2008 "Had a coethnic, non coethnic choice, 0/1"
{txt}
{com}. 
. /* create 3 category choice set variable (Ashanti level) */
. gen choice_set = 0 if co_eth_parl_2008 == 0
{txt}(2,001 missing values generated)

{com}. replace choice_set = 1 if co_eth_choice_parl_2008 == 1
{txt}(1,109 real changes made)

{com}. replace choice_set = 2 if all_co_eth_parl_2008 == 1
{txt}(892 real changes made)

{com}. 
. lab var choice_set "choice set Ashanti level"
{txt}
{com}. 
. /*label define lable1 0 "no co-ethnic on ballot" 1 "mixed ballot" 2 "only co-ethnics on ballot"*/
. label values choice_set lable1 
{txt}
{com}. 
. /* Generate descriptive tables (Ghana) */
. /* Table 1 choice set table for Ghana (Ashanti level)*/
. /* Table 1 legislative choice set */
. tab choice_set

 {txt}choice set Ashanti level {c |}      Freq.     Percent        Cum.
{hline 26}{c +}{hline 35}
   no co-ethnic on ballot {c |}{res}      2,036       50.43       50.43
{txt}             mixed ballot {c |}{res}      1,109       27.47       77.90
{txt}only co-ethnics on ballot {c |}{res}        892       22.10      100.00
{txt}{hline 26}{c +}{hline 35}
                    Total {c |}{res}      4,037      100.00
{txt}
{com}. /* Table 1 presidential choice set */
. tab co_eth_prez_2008 

 {txt}Respondent {c |}
      has a {c |}
   coethnic {c |}
  candidate {c |}
    in 2008 {c |}
       prez {c |}
  elections {c |}
      [1/0] {c |}      Freq.     Percent        Cum.
{hline 12}{c +}{hline 35}
          0 {c |}{res}      2,649       65.62       65.62
{txt}          1 {c |}{res}      1,388       34.38      100.00
{txt}{hline 12}{c +}{hline 35}
      Total {c |}{res}      4,037      100.00
{txt}
{com}. 
. /* Table 2 decomposing ethnic voting for Ghana (Ashanti level)*/
. 
. /* Table 2 legislative */
. /* co-ethnic voting all voters*/
. tabulate vote_co_eth_parl_2008

 {txt}Respondent {c |}
  voted for {c |}
  co-ethnic {c |}
    in 2008 {c |}
       parl {c |}
  elections {c |}
      [1/0] {c |}      Freq.     Percent        Cum.
{hline 12}{c +}{hline 35}
          0 {c |}{res}      2,258       61.11       61.11
{txt}          1 {c |}{res}      1,437       38.89      100.00
{txt}{hline 12}{c +}{hline 35}
      Total {c |}{res}      3,695      100.00
{txt}
{com}. /* coethnic voting only voters with mixed choice set */  
. tabulate vote_co_eth_parl_2008 if co_eth_choice_parl_2008 == 1

 {txt}Respondent {c |}
  voted for {c |}
  co-ethnic {c |}
    in 2008 {c |}
       parl {c |}
  elections {c |}
      [1/0] {c |}      Freq.     Percent        Cum.
{hline 12}{c +}{hline 35}
          0 {c |}{res}        375       38.19       38.19
{txt}          1 {c |}{res}        607       61.81      100.00
{txt}{hline 12}{c +}{hline 35}
      Total {c |}{res}        982      100.00
{txt}
{com}. 
. /* Table 2 presidential */
. /* co-ethnic voting all voters*/
. tab vote_co_eth_prez_2008

 {txt}Respondent {c |}
  voted for {c |}
  co-ethnic {c |}
    in 2008 {c |}
       prez {c |}
  elections {c |}
      [1/0] {c |}      Freq.     Percent        Cum.
{hline 12}{c +}{hline 35}
          0 {c |}{res}      3,530       91.78       91.78
{txt}          1 {c |}{res}        316        8.22      100.00
{txt}{hline 12}{c +}{hline 35}
      Total {c |}{res}      3,846      100.00
{txt}
{com}. /* coethnic voting only voters with mixed choice set */
. tab vote_co_eth_prez_2008 if co_eth_prez_2008 == 1

 {txt}Respondent {c |}
  voted for {c |}
  co-ethnic {c |}
    in 2008 {c |}
       prez {c |}
  elections {c |}
      [1/0] {c |}      Freq.     Percent        Cum.
{hline 12}{c +}{hline 35}
          0 {c |}{res}      1,025       76.49       76.49
{txt}          1 {c |}{res}        315       23.51      100.00
{txt}{hline 12}{c +}{hline 35}
      Total {c |}{res}      1,340      100.00
{txt}
{com}. 
. 
. /* ****************************************** */
. /* AKAN LEVEL refinement */
. /* Figure 1 Ghana Ashanti vs. Akan Choice Sets and Appendix A-2 and A-3 Tables*/
. /* create continuous choice set (Ashanti level) */
. gen pct_coethnic_leg = num_co_eth_parl_2008/num_cand_parl_2008
{txt}(62 missing values generated)

{com}. lab var pct_coethnic_leg "Leg. Choice Set Percent Co-ethnic Ashanti level"
{txt}
{com}. 
. kdensity pct_coethnic_leg, title("Ghana Ashanti Level") xtitle("Percent choice set co-ethnic")
{res}{txt}
{com}. graph save ghana_legchoiceset_sub.gph, replace
{res}{txt}(file ghana_legchoiceset_sub.gph saved)

{com}. 
. /* create continuous choice set (Akan level) */
. /* variable created in candidate ethnicity recode*/
. 
. kdensity pct_coethnic_leg_cen, title("Ghana Akan Level") xtitle("Percent choice set co-ethnic")
{res}{txt}
{com}. graph save ghana_legchoiceset_super.gph, replace
{res}{txt}(file ghana_legchoiceset_super.gph saved)

{com}. 
. /*Figure 1 here */
. graph combine ghana_legchoiceset_sub.gph ghana_legchoiceset_super.gph, ycommon xcommon
{res}{txt}
{com}. 
. /* recalculate 3 category super group for Akan level */
. 
. /*gen choice_set_cen = 0 if co_eth_parl_2008_cen == 0*/
. replace choice_set_cen = 1 if co_eth_choice_parl_2008_cen == 1
{txt}(0 real changes made)

{com}. replace choice_set_cen = 2 if all_co_eth_parl_2008_cen == 1
{txt}(0 real changes made)

{com}. 
. /*lab var choice_set_cen "choice set Akan level"*/
. label values choice_set_cen lable1
{txt}
{com}. 
. /*reproduce Tables 1 for Akan level for appendix Table A1*/
. /* legislative AKAN */
. tabulate choice_set_cen

    {txt}choice set Akan level {c |}      Freq.     Percent        Cum.
{hline 26}{c +}{hline 35}
   no co-ethnic on ballot {c |}{res}      1,003       24.85       24.85
{txt}             mixed ballot {c |}{res}      1,385       34.31       59.15
{txt}only co-ethnics on ballot {c |}{res}      1,649       40.85      100.00
{txt}{hline 26}{c +}{hline 35}
                    Total {c |}{res}      4,037      100.00
{txt}
{com}. /* presidential AKAN */
. tabulate co_eth_prez_2008_cen

 {txt}Respondent {c |}
      has a {c |}
   coethnic {c |}
  candidate {c |}
    in 2008 {c |}
presidentia {c |}
l elections {c |}
 AKAN level {c |}      Freq.     Percent        Cum.
{hline 12}{c +}{hline 35}
          0 {c |}{res}      1,201       29.75       29.75
{txt}          1 {c |}{res}      2,836       70.25      100.00
{txt}{hline 12}{c +}{hline 35}
      Total {c |}{res}      4,037      100.00
{txt}
{com}. 
. /* reproduce Table 2 decompose ethnic voting for super group (Akan level) Table A2*/
. /* legislative AKAN*/
. tabulate vote_co_eth_parl_2008_cen  

 {txt}Respondent {c |}
voted for a {c |}
   coethnic {c |}
  candidate {c |}
    in 2008 {c |}
parliamenta {c |}
         ry {c |}
  elections {c |}
     AKAN l {c |}      Freq.     Percent        Cum.
{hline 12}{c +}{hline 35}
          0 {c |}{res}      1,235       34.19       34.19
{txt}          1 {c |}{res}      2,377       65.81      100.00
{txt}{hline 12}{c +}{hline 35}
      Total {c |}{res}      3,612      100.00
{txt}
{com}. tabulate vote_co_eth_parl_2008_cen if co_eth_choice_parl_2008_cen == 1

 {txt}Respondent {c |}
voted for a {c |}
   coethnic {c |}
  candidate {c |}
    in 2008 {c |}
parliamenta {c |}
         ry {c |}
  elections {c |}
     AKAN l {c |}      Freq.     Percent        Cum.
{hline 12}{c +}{hline 35}
          0 {c |}{res}        403       32.24       32.24
{txt}          1 {c |}{res}        847       67.76      100.00
{txt}{hline 12}{c +}{hline 35}
      Total {c |}{res}      1,250      100.00
{txt}
{com}. 
. /* presidential AKAN*/
. tab vote_co_eth_prez_2008_cen

 {txt}Respondent {c |}
voted for a {c |}
   coethnic {c |}
  candidate {c |}
    in 2008 {c |}
presidentia {c |}
l elections {c |}
    AKAN le {c |}      Freq.     Percent        Cum.
{hline 12}{c +}{hline 35}
          0 {c |}{res}      1,813       47.14       47.14
{txt}          1 {c |}{res}      2,033       52.86      100.00
{txt}{hline 12}{c +}{hline 35}
      Total {c |}{res}      3,846      100.00
{txt}
{com}. tab vote_co_eth_prez_2008_cen if co_eth_prez_2008_cen == 1

 {txt}Respondent {c |}
voted for a {c |}
   coethnic {c |}
  candidate {c |}
    in 2008 {c |}
presidentia {c |}
l elections {c |}
    AKAN le {c |}      Freq.     Percent        Cum.
{hline 12}{c +}{hline 35}
          0 {c |}{res}        676       24.95       24.95
{txt}          1 {c |}{res}      2,033       75.05      100.00
{txt}{hline 12}{c +}{hline 35}
      Total {c |}{res}      2,709      100.00
{txt}
{com}. 
. /* ************************************************ */
. /* APPENDIX top party co-ethnic refinement Table A-3 Appendix*/
. 
. /* create variable: has NPP or NDC co-ethnic */
. gen NPP_coethnic = 1 if cand_eth_npp_parl_2008 == resp_eth_code
{txt}(2,538 missing values generated)

{com}. replace NPP_coethnic = 0 if cand_eth_npp_parl_2008 != resp_eth_code
{txt}(2,538 real changes made)

{com}. replace NPP_coethnic = . if cand_eth_npp_parl_2008 == . | resp_eth_code ==.
{txt}(26 real changes made, 26 to missing)

{com}. 
. gen NDC_coethnic = 1 if cand_eth_ndc_parl_2008 == resp_eth_code
{txt}(2,518 missing values generated)

{com}. replace NDC_coethnic = 0 if cand_eth_ndc_parl_2008 != resp_eth_code
{txt}(2,518 real changes made)

{com}. replace NDC_coethnic = . if cand_eth_ndc_parl_2008 == . | resp_eth_code ==.
{txt}(24 real changes made, 24 to missing)

{com}. 
. gen NPPorNDC_coethnic = 1 if NPP_coethnic == 1 | NDC_coethnic == 1
{txt}(2,248 missing values generated)

{com}. replace NPPorNDC_coethnic = 0 if NPP_coethnic == 0 & NDC_coethnic == 0
{txt}(2,236 real changes made)

{com}. replace NPPorNDC_coethnic = . if NPP_coethnic == . | NDC_coethnic == .
{txt}(38 real changes made, 38 to missing)

{com}. 
. tabulate NPPorNDC_coethnic

{txt}NPPorNDC_co {c |}
     ethnic {c |}      Freq.     Percent        Cum.
{hline 12}{c +}{hline 35}
          0 {c |}{res}      2,236       56.08       56.08
{txt}          1 {c |}{res}      1,751       43.92      100.00
{txt}{hline 12}{c +}{hline 35}
      Total {c |}{res}      3,987      100.00
{txt}
{com}. tabulate co_eth_parl_2008

 {txt}Respondent {c |}
      has a {c |}
   coethnic {c |}
  candidate {c |}
    in 2008 {c |}
       parl {c |}
  elections {c |}
      [1/0] {c |}      Freq.     Percent        Cum.
{hline 12}{c +}{hline 35}
          0 {c |}{res}      2,036       50.43       50.43
{txt}          1 {c |}{res}      2,001       49.57      100.00
{txt}{hline 12}{c +}{hline 35}
      Total {c |}{res}      4,037      100.00
{txt}
{com}. 
. /* note, to calculate "has major party co-ethnic" for Table A-3, divide count of NPPorNDC_coethnic ==1 by total obs in co_eth_parl_2008 */
. 
. 
. 
. /******************************************************************************/
. /*                                                      Kenya                                                     */
. /******************************************************************************/
. 
. 
. /* Load Kenya data */
. clear
{txt}
{com}. use "/Users/karenferree/Documents/BOOK/stata work/JOP_replication/Kef_jop_kenya.dta", clear
{txt}
{com}. 
. 
. /* Creating choice set variables for Kenya legislative elections */
. 
. /* create mixed choice set variable */ 
. gen co_eth_choice_parl_2007 = 1 if all_co_eth_parl_2007 == 0 & co_eth_parl_2007 == 1
{txt}(3,896 missing values generated)

{com}. replace co_eth_choice_parl_2007 = 0 if all_co_eth_parl_2007 == 1 | co_eth_parl_2007 == 0
{txt}(3,568 real changes made)

{com}. lab var co_eth_choice_parl_2007 "Had a coethnic, non coethnic choice, 0/1"
{txt}
{com}. 
. /* create 3 category choice set variable */
. gen choice_set = 0 if co_eth_parl_2007 == 0
{txt}(4,753 missing values generated)

{com}. replace choice_set = 1 if co_eth_choice_parl_2007 == 1
{txt}(1,599 real changes made)

{com}. replace choice_set = 2 if all_co_eth_parl_2007 == 1
{txt}(2,826 real changes made)

{com}. 
. lab var choice_set "choice set"
{txt}
{com}. 
. label define lable1 0 "no co-ethnic on ballot" 1 "mixed ballot" 2 "only co-ethnics on ballot"
{txt}
{com}. label values choice_set lable1 
{txt}
{com}. 
. /* Generate Descriptive tables Kenya */
. /* Table 1 choice set table for Kenya*/
. /* Table 1 legislative choice set */
. tabulate choice_set

               {txt}choice set {c |}      Freq.     Percent        Cum.
{hline 26}{c +}{hline 35}
   no co-ethnic on ballot {c |}{res}        742       14.36       14.36
{txt}             mixed ballot {c |}{res}      1,599       30.95       45.31
{txt}only co-ethnics on ballot {c |}{res}      2,826       54.69      100.00
{txt}{hline 26}{c +}{hline 35}
                    Total {c |}{res}      5,167      100.00
{txt}
{com}. 
. /* Table 1 presidential choice set */
. tabulate co_eth_prez_2007 

 {txt}Respondent {c |}
      has a {c |}
   coethnic {c |}
  candidate {c |}
    in 2007 {c |}
       prez {c |}
  elections {c |}
      [1/0] {c |}      Freq.     Percent        Cum.
{hline 12}{c +}{hline 35}
          0 {c |}{res}      1,976       38.24       38.24
{txt}          1 {c |}{res}      3,191       61.76      100.00
{txt}{hline 12}{c +}{hline 35}
      Total {c |}{res}      5,167      100.00
{txt}
{com}. 
. /* Table 2 decomposing ethnic voting for Kenya*/
. 
. /* Table 2 legislative */
. /* co-ethnic voting all voters*/
. tabulate vote_co_eth_parl_2007

 {txt}Respondent {c |}
  voted for {c |}
  co-ethnic {c |}
    in 2007 {c |}
       parl {c |}
  elections {c |}
      [1/0] {c |}      Freq.     Percent        Cum.
{hline 12}{c +}{hline 35}
          0 {c |}{res}        966       21.74       21.74
{txt}          1 {c |}{res}      3,477       78.26      100.00
{txt}{hline 12}{c +}{hline 35}
      Total {c |}{res}      4,443      100.00
{txt}
{com}. /* coethnic voting only voters with mixed choice set */  
. tabulate vote_co_eth_parl_2007 if co_eth_choice_parl_2007 == 1

 {txt}Respondent {c |}
  voted for {c |}
  co-ethnic {c |}
    in 2007 {c |}
       parl {c |}
  elections {c |}
      [1/0] {c |}      Freq.     Percent        Cum.
{hline 12}{c +}{hline 35}
          0 {c |}{res}        367       26.29       26.29
{txt}          1 {c |}{res}      1,029       73.71      100.00
{txt}{hline 12}{c +}{hline 35}
      Total {c |}{res}      1,396      100.00
{txt}
{com}. 
. /* Table 2 presidential */
. /* co-ethnic voting all voters*/
. tabulate vote_co_eth_prez_2007

 {txt}Respondent {c |}
  voted for {c |}
  co-ethnic {c |}
    in 2007 {c |}
       prez {c |}
  elections {c |}
      [1/0] {c |}      Freq.     Percent        Cum.
{hline 12}{c +}{hline 35}
          0 {c |}{res}      2,785       55.02       55.02
{txt}          1 {c |}{res}      2,277       44.98      100.00
{txt}{hline 12}{c +}{hline 35}
      Total {c |}{res}      5,062      100.00
{txt}
{com}. /* coethnic voting only voters with mixed choice set */
. tabulate vote_co_eth_prez_2007 if co_eth_prez_2007 == 1

 {txt}Respondent {c |}
  voted for {c |}
  co-ethnic {c |}
    in 2007 {c |}
       prez {c |}
  elections {c |}
      [1/0] {c |}      Freq.     Percent        Cum.
{hline 12}{c +}{hline 35}
          0 {c |}{res}        857       27.50       27.50
{txt}          1 {c |}{res}      2,259       72.50      100.00
{txt}{hline 12}{c +}{hline 35}
      Total {c |}{res}      3,116      100.00
{txt}
{com}. 
. /* ************************************* */
. /* APPENDIX has PNU co-ethnic Table A-3 Refinement*/
. /* create variable: has PNU co-ethnic */
. gen PNU_coethnic = 1 if cand_eth_pnu_parl_2007 == resp_eth_code
{txt}(2,609 missing values generated)

{com}. replace PNU_coethnic = 0 if cand_eth_pnu_parl_2007 != resp_eth_code
{txt}(2,609 real changes made)

{com}. replace PNU_coethnic = . if cand_eth_pnu_parl_2007 == . | resp_eth_code == .
{txt}(1,859 real changes made, 1,859 to missing)

{com}. 
. tabulate PNU_coethnic 

{txt}PNU_coethni {c |}
          c {c |}      Freq.     Percent        Cum.
{hline 12}{c +}{hline 35}
          0 {c |}{res}        847       23.29       23.29
{txt}          1 {c |}{res}      2,789       76.71      100.00
{txt}{hline 12}{c +}{hline 35}
      Total {c |}{res}      3,636      100.00
{txt}
{com}. tabulate co_eth_parl_2007

 {txt}Respondent {c |}
      has a {c |}
   coethnic {c |}
  candidate {c |}
    in 2007 {c |}
       parl {c |}
  elections {c |}
      [1/0] {c |}      Freq.     Percent        Cum.
{hline 12}{c +}{hline 35}
          0 {c |}{res}        742       14.36       14.36
{txt}          1 {c |}{res}      4,425       85.64      100.00
{txt}{hline 12}{c +}{hline 35}
      Total {c |}{res}      5,167      100.00
{txt}
{com}. /* note, to calculate "has major party co-ethnic" for Table A-3, divide count of PNU_coethnic ==1 by total obs in co_eth_parl_2007 */
. 
. /******************************************************************************/
. /*                                                      Uganda                                            */
. /******************************************************************************/
. 
. 
. /* Load Uganda data */
. clear
{txt}
{com}. use "/Users/karenferree/Documents/BOOK/stata work/JOP_replication/Kef_jop_uganda.dta", clear
{txt}
{com}. 
. 
. /* Create choice set variables for Uganda legislative elections */
. 
. /* create mixed choice set variable*/
. gen co_eth_choice_parl_2011 = 1 if all_co_eth_parl_2011 == 0 & co_eth_parl_2011 == 1
{txt}(2,849 missing values generated)

{com}. replace co_eth_choice_parl_2011 = 0 if all_co_eth_parl_2011 == 1 | co_eth_parl_2011 == 0
{txt}(2,842 real changes made)

{com}. lab var co_eth_choice_parl_2011 "Had a coethnic, non coethnic choice, 0/1"
{txt}
{com}. 
. /* create 3 category choice set variable*/
. gen choice_set = 0 if co_eth_parl_2011 == 0
{txt}(2,817 missing values generated)

{com}. replace choice_set = 1 if co_eth_choice_parl_2011 == 1
{txt}(1,114 real changes made)

{com}. replace choice_set = 2 if all_co_eth_parl_2011 == 1
{txt}(1,696 real changes made)

{com}. 
. lab var choice_set "choice set"
{txt}
{com}. 
. label define lable1 0 "no co-ethnic on ballot" 1 "mixed ballot" 2 "only co-ethnics on ballot"
{txt}
{com}. label values choice_set lable1 
{txt}
{com}. 
. /* Generate Descriptive tables Uganda */
. /* Table 1 for Uganda */
. /* Table 1 legislative choice set */
. tabulate choice_set

               {txt}choice set {c |}      Freq.     Percent        Cum.
{hline 26}{c +}{hline 35}
   no co-ethnic on ballot {c |}{res}      1,146       28.97       28.97
{txt}             mixed ballot {c |}{res}      1,114       28.16       57.13
{txt}only co-ethnics on ballot {c |}{res}      1,696       42.87      100.00
{txt}{hline 26}{c +}{hline 35}
                    Total {c |}{res}      3,956      100.00
{txt}
{com}. 
. /* Table 1 presidential choice set */
. tabulate co_eth_prez_2011 

 {txt}Respondent {c |}
      has a {c |}
   coethnic {c |}
  candidate {c |}
    in 2011 {c |}
       prez {c |}
  elections {c |}
      [1/0] {c |}      Freq.     Percent        Cum.
{hline 12}{c +}{hline 35}
          0 {c |}{res}      2,259       57.10       57.10
{txt}          1 {c |}{res}      1,697       42.90      100.00
{txt}{hline 12}{c +}{hline 35}
      Total {c |}{res}      3,956      100.00
{txt}
{com}. 
. /* Table 2 decomposing ethnic voting for Uganda*/
. 
. /* Table 2 legislative */
. /* co-ethnic voting all voters*/
. tabulate vote_co_eth_parl_2011

 {txt}Respondent {c |}
  voted for {c |}
  co-ethnic {c |}
    in 2011 {c |}
       parl {c |}
  elections {c |}
      [1/0] {c |}      Freq.     Percent        Cum.
{hline 12}{c +}{hline 35}
          0 {c |}{res}      1,152       39.13       39.13
{txt}          1 {c |}{res}      1,792       60.87      100.00
{txt}{hline 12}{c +}{hline 35}
      Total {c |}{res}      2,944      100.00
{txt}
{com}. /* coethnic voting only voters with mixed choice set */  
. tabulate vote_co_eth_parl_2011 if co_eth_choice_parl_2011 == 1

 {txt}Respondent {c |}
  voted for {c |}
  co-ethnic {c |}
    in 2011 {c |}
       parl {c |}
  elections {c |}
      [1/0] {c |}      Freq.     Percent        Cum.
{hline 12}{c +}{hline 35}
          0 {c |}{res}        316       36.70       36.70
{txt}          1 {c |}{res}        545       63.30      100.00
{txt}{hline 12}{c +}{hline 35}
      Total {c |}{res}        861      100.00
{txt}
{com}. 
. /* Table 2 presidential */
. /* co-ethnic voting all voters*/
. tabulate vote_co_eth_prez_2011

 {txt}Respondent {c |}
  voted for {c |}
  co-ethnic {c |}
    in 2011 {c |}
       prez {c |}
  elections {c |}
      [1/0] {c |}      Freq.     Percent        Cum.
{hline 12}{c +}{hline 35}
          0 {c |}{res}      2,890       87.02       87.02
{txt}          1 {c |}{res}        431       12.98      100.00
{txt}{hline 12}{c +}{hline 35}
      Total {c |}{res}      3,321      100.00
{txt}
{com}. /* coethnic voting only voters with mixed choice set */
. tabulate vote_co_eth_prez_2011 if co_eth_prez_2011 == 1

 {txt}Respondent {c |}
  voted for {c |}
  co-ethnic {c |}
    in 2011 {c |}
       prez {c |}
  elections {c |}
      [1/0] {c |}      Freq.     Percent        Cum.
{hline 12}{c +}{hline 35}
          0 {c |}{res}        957       68.95       68.95
{txt}          1 {c |}{res}        431       31.05      100.00
{txt}{hline 12}{c +}{hline 35}
      Total {c |}{res}      1,388      100.00
{txt}
{com}. 
. /* ************************************* */
. /* APPENDIX has NRM co-ethnic for Table A-3 Refinement*/
. 
. /* create has NRM co-ethnic */
. gen NRM_coethnic = 1 if cand_eth_nrm_parl_2011 == resp_eth_code
{txt}(1,721 missing values generated)

{com}. replace NRM_coethnic = 0 if cand_eth_nrm_parl_2011 != resp_eth_code
{txt}(1,721 real changes made)

{com}. replace NRM_coethnic = . if cand_eth_nrm_parl_2011 == . | resp_eth_code == .
{txt}(49 real changes made, 49 to missing)

{com}. 
. tabulate NRM_coethnic

{txt}NRM_coethni {c |}
          c {c |}      Freq.     Percent        Cum.
{hline 12}{c +}{hline 35}
          0 {c |}{res}      1,672       42.72       42.72
{txt}          1 {c |}{res}      2,242       57.28      100.00
{txt}{hline 12}{c +}{hline 35}
      Total {c |}{res}      3,914      100.00
{txt}
{com}. tabulate co_eth_parl_2011

 {txt}Respondent {c |}
      has a {c |}
   coethnic {c |}
  candidate {c |}
    in 2011 {c |}
       parl {c |}
  elections {c |}
      [1/0] {c |}      Freq.     Percent        Cum.
{hline 12}{c +}{hline 35}
          0 {c |}{res}      1,146       28.97       28.97
{txt}          1 {c |}{res}      2,810       71.03      100.00
{txt}{hline 12}{c +}{hline 35}
      Total {c |}{res}      3,956      100.00
{txt}
{com}. /* note, to calculate "has major party co-ethnic" for Table A-3, divide count of NRM_coethnic ==1 by total obs in co_eth_parl_2011 */
. 
. 
. 
. 
{txt}end of do-file

{com}. log close
      {txt}name:  {res}<unnamed>
       {txt}log:  {res}/Users/karenferree/Documents/BOOK/Choice and Choice Set/JOP_note/January 2021/Revised version/Log file of replication.smcl
  {txt}log type:  {res}smcl
 {txt}closed on:  {res}16 Jul 2021, 15:51:29
{txt}{.-}
{smcl}
{txt}{sf}{ul off}